package com.huanwei.questionfragment.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.huanwei.cc.base.Base_Z_Adapter;
import com.huanwei.cc.base.MyApplication;
import com.huanwei.cc.R;
import com.huanwei.cc.bean.Life_MSG3;


/**
 * Created by 他的猫 on 2016/12/3.
 * 已回答适配器
 */

public class Already_answered_Adapter extends Base_Z_Adapter {
    Already_answered_Adapter.Holder holder;


    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        // 查找控件
        if (null == convertView) {
            convertView = LayoutInflater.from(MyApplication.getInstance())
                    .inflate(R.layout.item_two, null);
            holder = new Already_answered_Adapter.Holder();
            holder.name = (TextView) convertView
                    .findViewById(R.id.name);
            holder.xueke = (TextView) convertView
                    .findViewById(R.id.xueke);

            holder.shijian = (TextView) convertView
                    .findViewById(R.id.shijian);
            holder.word = (TextView) convertView
                    .findViewById(R.id.word);

            // 缓存Holder
            convertView.setTag(holder);
        } else {
            holder = (Already_answered_Adapter.Holder) convertView.getTag();
        }
        final Life_MSG3 teacher = (Life_MSG3) mDataList.get(position);

        holder.name.setText(teacher.getTitle());
        holder.word.setText(teacher.getTime());
        holder.xueke .setText(teacher.getMSG());
        return convertView;
    }

    public class Holder {
        TextView name;
        TextView xueke;
        TextView shijian;
        TextView word;

        LinearLayout me_fragment_Fans;
    }


}
